


:root {
  --primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --dark: #1f2937;
  --light: #f9fafb;
  --gray: #6b7280;
  --card-bg: rgba(255, 255, 255, 0.95);
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --card-bg: rgba(31, 41, 55, 0.95);
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --border: #374151;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow-x: hidden;
  transition: var(--transition);
}

/* Background con imagen y overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/img/Fondo.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0.6;
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  backdrop-filter: blur(5px);
  z-index: -1;
}

/* Animaciones globales */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glideIn {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  animation: fadeInUp 0.6s ease-out;
}

/* Card Principal */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 32px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 35px -12px rgba(0, 0, 0, 0.25);
}

/* Header */
.header {
  background: var(--primary);
  padding: 32px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
  animation: rotate 20s linear infinite;
}

.header h1 {
  font-size: 2rem;
  color: white;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.badge i {
  margin-right: 5px;
}

/* Theme Toggle */
.theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(180deg);
}

.theme-toggle i {
  color: white;
  font-size: 1.2rem;
}

/* Content */
.content {
  padding: 32px;
}

/* Input Groups */
.input-group {
  margin-bottom: 24px;
  position: relative;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 16px;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 1.1rem;
  z-index: 1;
}

.input-wrapper input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-size: 1.1rem;
  transition: var(--transition);
  background: var(--card-bg);
  color: var(--text-primary);
  font-weight: 500;
}

.input-wrapper input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  outline: none;
  transform: scale(1.02);
}

.input-wrapper input.error {
  border-color: var(--error);
  animation: shake 0.5s ease;
}

/* Exchange Icon */
.exchange-icon {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  position: relative;
}

.exchange-icon .icon-bg {
  background: linear-gradient(135deg, #667eea20, #764ba220);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: float 2s ease-in-out infinite;
}

.exchange-icon i {
  font-size: 2rem;
  color: var(--primary-color);
}

/* Result Container */
.result-container {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  border-radius: 24px;
  padding: 24px;
  margin-top: 24px;
  text-align: center;
  border: 2px solid rgba(102, 126, 234, 0.2);
  transition: var(--transition);
  cursor: pointer;
}

.result-container:hover {
  transform: scale(1.02);
  border-color: var(--primary-color);
}

.result-container.active {
  animation: pulse 0.5s ease;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
  border-color: var(--success);
}

.result-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.result-value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  word-break: break-word;
}

/* Info Bar */
.info-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.info-card {
  background: rgba(102, 126, 234, 0.05);
  border-radius: 20px;
  padding: 16px;
  text-align: center;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.info-card:hover {
  transform: translateY(-3px);
  background: rgba(102, 126, 234, 0.1);
}

.info-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.info-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Auto Update Status */
.auto-update-status {
  text-align: center;
  margin-top: 20px;
  padding: 10px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.auto-update-status i {
  color: var(--primary-color);
  margin-right: 8px;
}

/* Buttons */
.buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.btn {
  padding: 14px;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

/* Loader Overlay */
.loader-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.loader-overlay.active {
  display: flex;
  animation: fadeInUp 0.3s ease;
}

.loader-spinner {
  text-align: center;
  background: var(--card-bg);
  padding: 40px;
  border-radius: 32px;
  box-shadow: var(--shadow-xl);
}

.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-spinner p {
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: fadeInUp 0.3s ease;
}

.modal-content {
  background: var(--card-bg);
  border-radius: 32px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  animation: glideIn 0.4s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
  background: var(--primary);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  color: white;
  font-size: 1.3rem;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: 60vh;
}

.history-list {
  margin-top: 16px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 16px;
  transition: var(--transition);
  animation: fadeInUp 0.4s ease;
}

.history-item:hover {
  transform: translateX(5px);
  background: rgba(102, 126, 234, 0.1);
}

.history-amount {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.history-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.btn-use {
  background: var(--primary);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  color: white;
}

.btn-use:hover {
  transform: rotate(180deg);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--card-bg);
  color: var(--text-primary);
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 1001;
  border-left: 4px solid var(--success);
}

.toast.active {
  transform: translateX(0);
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--error);
}

.toast i {
  font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 640px) {
  .container {
    padding: 16px;
  }
  
  .content {
    padding: 24px;
  }
  
  .buttons {
    grid-template-columns: 1fr;
  }
  
  .result-value {
    font-size: 1.5rem;
  }
  
  .info-bar {
    grid-template-columns: 1fr;
  }
  
  .header h1 {
    font-size: 1.5rem;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

::selection {
  background: var(--primary-color);
  color: white;
}